package com.edu.dgut.dao;

import com.edu.dgut.entity.classificationEntity;
import org.springframework.data.jpa.repository.JpaRepository;

import javax.transaction.Transactional;
import java.util.List;

public interface classificationRepository extends JpaRepository<classificationEntity,String> {

    //通过分类名查询分类信息
    List<classificationEntity> findByCategoryLike(String category);

    //插入或修改分类信息
    classificationEntity save(classificationEntity classification);

    //通过分类名删除分类信息
    @Transactional
    int deleteByCategory(String category);

}
